<?php
namespace Home\Controller;
use Think\Controller;
class ShownewsController extends Controller {

    public function shownews(){
        //接收参数
        $nav=M('nav')->select();
        $this->assign('nav',$nav);
        $aid=I('get.aid');
        $article=M('article')->where("art_id=$aid")->find();
        $this->assign('article',$article);

        $prev=M('article')->where("art_id<$aid AND is_show=1")->find();
        $this->assign('prev',$prev);
        
        $next=M('article')->where("art_id>$aid AND is_show=1")->find();
        $this->assign('next',$next);
        
        //右侧推荐
        $Recommend=M('article')->where("is_show=1")->order('art_pageview DESC')->limit(5)->select();
        $this->assign('Recommend',$Recommend);
        //配置
        $logo=M('config')->where('con_title="logo"')->find();
        $this->assign('logo',$logo);
        $icp=M('config')->where('con_title="备案号"')->find();
        $this->assign('icp',$icp);

        $this->display();
    }
}